package controller.teacher.manager.score;

import java.io.IOException;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import view.DataList;

import dao.Score;
import dao.Student;

@WebServlet("/teacher/manager/score")
public class score extends controller.teacher.manager.Base {
    private static final long serialVersionUID = 1L;

    public score() {
        super();
    }

    protected void doGet(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
        try {
            Integer id = new Integer(request.getParameter("id"));
            Student.Data stud = Student.findById(id);
            DataList<Score.Data> d = Score.selectByStuId(id);
            view.displayMap("teacher/score/index.jsp",
                    "list", d,
                    "stud", stud);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    protected void doPost(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
    }

}
